/**************************************************************
 *
 * Copyright (c) 2008, ******, All Rights Reserved.
 *
 * 名 称:
 *		err.h
 * 位 置:
 *		inc/pub/err.h
 * 描 述:
 *		公用异常类
 * 备 注:
 *		无
 * 修 改:
 *		2008-09-20  Simon   - 创建
 *
 **************************************************************/

#ifndef __PUB_ERR_H__
#define __PUB_ERR_H__

#include <exception>
#include <string>

using namespace std;

class AppException : public exception
{
public:
	AppException() throw();
	AppException(const char* msg) throw();
	AppException(unsigned code, const char* msg) throw();
	virtual ~AppException() throw();

	unsigned getCode() const;
	const char* getMsg() const;
	AppException* setCode(unsigned code);
	AppException* setMsg(const char* msg);
	AppException* set(unsigned code, const char* msg);

private:
	unsigned code;
	char msg[100 + 1];
};

#endif
